<!--
// +----------------------------------------------------------------------
// | Copyright (c) 2017 https://gitee.com/honoryao All rights reserved.
// +----------------------------------------------------------------------
// | Author: honoryao <2463523099@qq.com>
// +----------------------------------------------------------------------
// | Time: 2018/6/8   
// +----------------------------------------------------------------------
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Component 父子组件关系</title>
</head>
<body>
<h1>Component 父子组件关系</h1>
<hr>
<div id="app">
    <jspang></jspang>
    <jspang2></jspang2>
</div>
<script src="../assets/js/vue.js"></script>
<script type="text/javascript">
    var jspang = {
        template: `<div>Panda from China!</div>`
    };
    var city = {
        template: `<div>Sichuan of China</div>`
    };
    var jspang2 = {
        template: `<div>
                    <p> Panda from China!</p>
                    <city></city>
            </div>`,
        components: {
            "city": city
        }
    };
    var app = new Vue({
        el: '#app',
        data: {
            message: 'SiChuan'
        },
        components: {
            "jspang": jspang,
            "jspang2": jspang2
        }
    });

    var app = new Vue({
        el: '#app',
        components: {
            "jspang": jspang
        }

    })
    //    var app=new Vue({
    //        el:'#app',
    //        components:{
    //            "panda2":{
    //                template:`<div style="color:red;">Panda from {{ here }}.</div>`,
    //                props:['fromHere']
    //            }
    //        }
    //    });
</script>
</body>
</html>